<!-- 报表 》 设备报表 -->

<template>
  <div class="full">
    <DeviceAll v-if="type === TYPE[0][0]" v-bind="param" />

    <DeviceUsage v-if="type === TYPE[1][0]" v-bind="param" />

    <DeviceStock v-if="type === TYPE[2][0]" v-bind="param" />

    <DeviceInout v-if="type === TYPE[3][0]" v-bind="param" />

    <DeviceFlit v-if="type === TYPE[4][0]" v-bind="param" />

    <DeviceBackup v-if="type === TYPE[5][0]" v-bind="param" />

    <DeviceBorrow v-if="type === TYPE[6][0]" v-bind="param" />

    <DeviceDepreciation v-if="type === TYPE[7][0]" v-bind="param" />
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import { TYPE_DEVICE as TYPE } from '@admin/views/Maintain/Report/CONST'
import mixDevice from './mixDevice'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'ReportDevice',

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('./', true, /vue$/)),

  /**
   * 状态数据 (函数返回对象)
   */
  data() {
    return {
      type: TYPE[0][0],
      param: {
        hasType: true,
        startTime: mixDevice.props.startTime.default,
        endTime: mixDevice.props.endTime.default,
      },
    }
  },

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 类型
     */
    TYPE: () => TYPE,
  },
}
</script>

<style lang="scss">
@import '@admin/views/Maintain/Report/index.scss';
</style>
